//
//  ZCVisitorTableViewController.swift
//  weibo
//
//  Created by Ning Xie on 16/8/8.
//  Copyright © 2016年 itcast. All rights reserved.
//

import UIKit

class ZCVisitorTableViewController: UITableViewController {

    //判断是否登录成功
    var isLogin : Bool = ZCUserInfoViewModel.sharedUserInfo.isLogin
    
    var visitorView : ZCVisitorView?
    override func loadView() {
        if isLogin {
            super.loadView()
        }
        else{
            
            visitorView = ZCVisitorView()
            visitorView?.loginClosure = {[weak self] in
                
                self?.reqeustOAuthVC()
            }
            
            view = visitorView
            
        }
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
    }

    private func reqeustOAuthVC(){
        
        let OAuthV = ZCOAuthViewController()
        let nav = UINavigationController(rootViewController: OAuthV)
        presentViewController(nav, animated: true, completion: nil)
    }
    
    
    
    
}
